package com.moyq5.mvc.maker.test.bean.entity;

import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.PrePersist;
import javax.persistence.Table;

import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.GenericGenerator;

import com.moyq5.mvc.maker.test.bean.enums.VirtualAccountStatus;

/**
 * 虚拟账户
 * @author Moyq5
 * @date 2017年11月24日
 */
@Entity
@Table(name = "uc_virtual_account")
@DynamicUpdate
public class VirtualAccount implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	/**
	 * 账户ID（主键）
	 */
	@Id
    @GeneratedValue(strategy = GenerationType.AUTO, generator = "native")@GenericGenerator(name = "native", strategy = "native")
    @Column(name = "account_id")
	private Long accountId;
	/**
	 * 卡号
	 */
	@Column(name = "account_no", length = 30, nullable = false)
	private String accountNo;
	/**
	 * 账户状态
	 */
    @Enumerated(EnumType.ORDINAL)
    @Column(name = "status", length = 1, nullable = false, columnDefinition="int(1) default '0'")
	private VirtualAccountStatus status;
	/**
	 * 提现密码
	 */
	@Column(name = "pwd", length = 60, nullable = false)
	private String pwd;
	/**
	 * 密码加密参数
	 */
	@Column(name = "salt", length = 10, nullable = false)
	private String salt;
	/**
	 * 谷歌动态口令密钥
	 */
	@Column(name = "google_key", length = 32)
	private String googleKey;
	/**
	 * 可用金额（元）
	 */
    @Column(name = "amount_available", nullable = false, precision = 10, scale = 2)	
	private BigDecimal amountAvailable;
	/**
	 * 在途金额（元）
	 */
    @Column(name = "amount_intransit", nullable = false, precision = 10, scale = 2)	
	private BigDecimal amountIntransit;
	/**
	 * （金额）更新时间
	 */
	@Column(name = "mod_time", nullable = false, columnDefinition="datetime")
	private Date modTime;
	/**
	 * 添加时间
	 */
	@Column(name = "add_time", nullable = false, columnDefinition="datetime")
	private Date addTime;
	
	@PrePersist
	public void prePersist() {
		
	}
	public Long getAccountId() {
		return accountId;
	}
	public void setAccountId(Long accountId) {
		this.accountId = accountId;
	}
	public String getAccountNo() {
		return accountNo;
	}
	public void setAccountNo(String accountNo) {
		this.accountNo = accountNo;
	}
	public VirtualAccountStatus getStatus() {
		return status;
	}
	public void setStatus(VirtualAccountStatus status) {
		this.status = status;
	}
	public String getPwd() {
		return pwd;
	}
	public void setPwd(String pwd) {
		this.pwd = pwd;
	}
	public String getSalt() {
		return salt;
	}
	public void setSalt(String salt) {
		this.salt = salt;
	}
	public BigDecimal getAmountAvailable() {
		return amountAvailable;
	}
	public void setAmountAvailable(BigDecimal amountAvailable) {
		this.amountAvailable = amountAvailable;
	}
	public BigDecimal getAmountIntransit() {
		return amountIntransit;
	}
	public void setAmountIntransit(BigDecimal amountIntransit) {
		this.amountIntransit = amountIntransit;
	}
	public Date getModTime() {
		return modTime;
	}
	public void setModTime(Date modTime) {
		this.modTime = modTime;
	}
	public Date getAddTime() {
		return addTime;
	}
	public void setAddTime(Date addTime) {
		this.addTime = addTime;
	}
	public String getGoogleKey() {
		return googleKey;
	}
	public void setGoogleKey(String googleKey) {
		this.googleKey = googleKey;
	}
	
}
